package com.hua.designpattern.creational.abstractfactory;

public class FactoryCreator {
	public static AbstractFactory getFactory(String type) {
		if ("SHAPE".equalsIgnoreCase(type)) {
			return new ShapeFactory();
		} else if ("COLOR".equalsIgnoreCase(type)) {
			return new ColorFactory();
		} else {
			System.err.println("no factory named " + type + " can created");
			throw new NullPointerException();
		}
	}
}
